#include "ES.h"
#include <string>
#include <iostream>

using namespace std;

int main()
{
	XpensItem thisItem,emptyItem;
	ES coolSystem;
	string date;
	int op;
	int i;
	double income;
	bool flag = true;
	coolSystem.Alert();
	while (flag)
	{
		cout<<"1.addIncome\n"<<"2.create expense\n";
		cout<<"3.track expense\n"<<"4. undo\n"<<"5. redo\n"<<"6. show report\n7. exit\n";
		cin >> op;
		switch (op){
		case 1: cin>>income;
				coolSystem.addIncome(income);
				break;
		case 2:	cout << "name, price, category, date, venue\n"; 
			coolSystem.createItem();
			break;
			case 3: cin >> date;
				coolSystem.Track(date);
				cout << "update which one" <<endl;
				cin >> i;
				cout << "name, price, category, date, venue\n"; 
				coolSystem.updateItem(i);
				break;
			case 4: coolSystem.undo();
				break;
			case 5: coolSystem.redo();
				break;
			case 6: coolSystem.Report();
				break;
			case 7: flag = false;
				break;
		}
		coolSystem.Alert();
	}
/*	coolSystem.addIncome(300.0);
	coolSystem.getRecord().createItem(thisItem);
	coolSystem.undo();
	coolSystem.redo();*/
	coolSystem.updateFigure();
	return 0;
}